import http from "../../utils/http"
export interface RoleItem{
    _id?:string,
   name?:string,
   state?:number
   permissions?:string[],
   creator?:string
}

const roleManage = {
    // 查询角色分组数据
    // search: (data?: object) => http.post('/userGroups/search', data),
    search:(data?: object)=> http.post('/roles/search', data),
    // // 新增角色分组数据
    add: (data:RoleItem ) => http.post('/roles/add', data),
    // // 删除角色分组数据
    remove: (data: object) => http.delete('/roles/remove', data),
    // // 修改角色分组数据
    update: (data: RoleItem) => http.put('/roles/update', data)
}

export default roleManage